package com.hks360.car_treasure.common;

/**
 * Created by rwq on 2016/4/26.
 */
public class Method {
    public static int getI() {
        return i;
    }

    private static int i = 0;

    public static void setI(int i) {
        Method.i = i;
    }

    public static String getTboxId(){
        try {
            if(AppConfig.user.getTboxinfo() == null){
                return "";
            }
            if(AppConfig.user.getTboxinfo().size() != 0){
                return AppConfig.user.getTboxinfo().get(i).getTboxid();
            }else {
                return "";
            }
        }catch (Exception e){
            e.printStackTrace();
            return "";
        }

    }
    public static String getServer(){
        if(AppConfig.user.getTboxinfo().size() != 0){
            return AppConfig.user.getTboxinfo().get(i).getSocketserver();
        }else {
            return "";
        }
    }
    public static String getTboxId(int j){
        if(AppConfig.user.getTboxinfo().size() != 0){
            return AppConfig.user.getTboxinfo().get(j).getTboxid();
        }else {
            return "";
        }
    }
    public static String getCph(){
        if(AppConfig.user.getTboxinfo().size() != 0){
            return AppConfig.user.getTboxinfo().get(i).getCph();
        }else {
            return "";
        }
    }
    public static String getDeviceName(){
        if(AppConfig.user.getTboxinfo().size() != 0){
            return AppConfig.user.getTboxinfo().get(i).getEquipment();
        }else {
            return "";
        }
    }
    public static String getStartTime(){
        if(AppConfig.user.getTboxinfo().size() != 0){
            return AppConfig.user.getTboxinfo().get(0).getTboxtime();
        }else {
            return "";
        }
    }
    public static String getSimCard(){
        if(AppConfig.user.getTboxinfo().size() != 0){
            return AppConfig.user.getTboxinfo().get(0).getPhone();
        }else {
            return "";
        }
    }

    public static void setTboxId(){

    }
}
